package gold.digger;

import gold.utils.InputUtil;

/**
 * Created by fanzhenyu02 on 2021/12/10.
 * common problem solver template.
 */
public class LC908 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int smallestRangeI(int[] nums, int k) {
            int max = nums[0], min = nums[0];
            for (int i : nums) {
                max = Math.max(max, i);
                min = Math.min(min, i);
            }
            return Math.max(0, max - min - 2 * k);
        }
    }

    public void run() {
        int[] arr = InputUtil.toIntegerArray("[1,2,3]");
        System.out.println(new Solution().toString());
    }

    public static void main(String[] args) throws Exception {
        LC908 an = new LC908();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
